﻿using CodeBackup.Code;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CodeBackup
{
    public partial class FrmSet : Form
    {
        public FrmSet()
        {
            InitializeComponent();
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void FrmSet_Load(object sender, EventArgs e)
        {
            this.api.Text = ini.Api;
            this.mqtt.Text = ini.Mqtt;
            this.mport.Text = ini.Port.ToString();
            this.mqttuser.Text=ini.Mqttuser;
            this.mqttpas.Text=ini.Mqttpas;

        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            ini.Api= this.api.Text;
            ini.Mqtt = this.mqtt.Text;
            ini.Port= Convert.ToInt32( this.mport.Text) ;
            ini.Mqttuser= this.mqttuser.Text;
            ini.Mqttpas = this.mqttpas.Text;
            libedi.API.Clientbuss.ApiUrl = ini.Api;
            this.Close();
        }
    }
}
